import request from '../router/axios'

export function getPage(params) { // 分页查询我的消息通知
  return request({
    url: '/admin/sys/message/list/page',
    method: 'get',
    params
  })
}

export function markRead(id) { // 标记为已读
  return request({
    url: '/admin/sys/message/markRead',
    method: 'post',
    params: {
      id
    }
  })
}

export function getInfo(id) { // 根据id获取消息通知详情
  return request({
    url: '/admin/sys/message/' + id,
    method: 'get'
  })
}

export function getCount() { // 查询未读条数
  return request({
    url: '/admin/sys/message/unread/count',
    method: 'get'
  })
}

export function getNoticeForHomePageList() { // 首页查询待办
  return request({
    url: '/admin/sysnotifyremind/listForHomePage',
    method: 'get'
  })
}

export function setReadNoticeForHomePage(data) { // 首页批量设置已读
  return request({
    url: '/admin/sysnotifyremind/setRead',
    method: 'post',
    data
  })
}
